home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_pas
/
ootp_4
/
list6_2.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-03-28
|
836b
|
47 lines
program Listing6_2;
uses ListObj;
type
ClassA = object(Node)
Number1 : integer;
Number2 : integer;
Number3 : integer;
procedure Init( N1, N2, N3 : integer );
end;
ClassB = object(Node)
Real1 : real;
procedure Init( R1 : real );
end;
procedure ClassA.Init( N1, N2, N3 : integer );
begin
Node.Init( SizeOf( Self ) );
Number1 := N1;
Number2 := N2;
Number3 := N3;
end;
procedure ClassB.Init( R1 : real );
begin
Node.Init( SizeOf ( Self ));
Real1 := R1;
end;
var
ObjectA : ClassA;
ObjectB : ClassB;
MixList : List;
begin
MixList.Init;
ObjectA.Init( 1,2,3 );
ObjectB.Init( 3.1415 );
ObjectA.AppendToList( MixList );
MixList.Append( @ObjectB );
end.